<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>SpringBoot</title>
</head>
<body>
<h1>spring boot</h1>

<h3 th:text="'登录用户：' + ${name}"></h3>

<a href="/logout">注销</a>

<video id="sound" type="video/mp4" controls="controls" autoplay="autoplay"
       webkit-playsinline="true"    playsinline="true"   heigth="100%"></video>
<br />
<script>
    //创建XMLHttpRequest对象
    var xhr = new XMLHttpRequest();
    //配置请求方式、请求地址以及是否同步
    xhr.open('POST', '/getVideoSrc', true);
    //设置请求结果类型为blob
    xhr.responseType = 'blob';
    //请求成功回调函数
    xhr.onload = function(e) {
        if (this.status == 200) {//请求成功
            //获取blob对象
            var blob = this.response;
            //获取blob对象地址，并把值赋给容器
            $("#sound").attr("src", URL.createObjectURL(blob));
        }
    };
    xhr.send();
</script>
</body>
</html>